//
//  Student.m
//  OC02_方法
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Student.h"

@implementation Student

/** 重写父类方法: study方法 */
- (void)study {
    
    [super study];/* 注意: super不是对象,是编译器指令. 给super发消息,是调用父类中此方法的实现 */
    NSLog(@"数学");
}


- (void)setSchool:(NSString *)school{
    school = _school ;
}
- (NSString *)school{
    return _school;
}

- (void)setNumber:(NSInteger)number{
    number = _number;
}
- (NSInteger)number{
    return _number;
}


/*自定义初始化方法*/

- (instancetype)initWithName:(NSString *)name
                         age:(NSInteger)age
                         sex:(NSString *)sex
                      school:(NSString *)school
                      number:(NSInteger)number {
    
    self = [super initWithName:name age:age sex:sex];
    if (self) {
        _school = school;
        _number = number;
    }
    return self;
    
    
}





@end
